package com.company.bookstore.entities.order_module;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.company.bookstore.entities.book_module.Book;
import com.company.bookstore.entities.user_admin_module.Address;
import com.company.bookstore.entities.user_admin_module.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author 赵云霞
 * @since 2020-09-08
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_order")
public class Order  {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String orderNum;
    private Integer status;
    private Double price;
    private Integer num;
    private Double totalPrice;
    private String evaluate;
    private Integer grade;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//頁面傳入數據到數據庫自動格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//頁面傳入數據到數據庫自動格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date finishTime;
    private Integer fkUserId;
    private Integer fkBookId;
    private Integer orderAdd;
    private Integer deleted;
    @TableField(exist = false)
    private User user;
    @TableField(exist = false)
    private Book book;
    @TableField(exist = false)
    Logistics logistics;
    @TableField(exist = false)
    private Address address;


}
